package logic

import (
	"context"
	"go.uber.org/zap"
	"order_srv/internal/dao"
	"order_srv/internal/svc"
	"order_srv/order"
	"smart-health-platforms/pkg"

	"github.com/zeromicro/go-zero/core/logx"
)

type InvoiceReviewLogic struct {
	ctx    context.Context
	svcCtx *svc.ServiceContext
	logx.Logger
}

func NewInvoiceReviewLogic(ctx context.Context, svcCtx *svc.ServiceContext) *InvoiceReviewLogic {
	return &InvoiceReviewLogic{
		ctx:    ctx,
		svcCtx: svcCtx,
		Logger: logx.WithContext(ctx),
	}
}

// 发票审核
func (l *InvoiceReviewLogic) InvoiceReview(in *order.InvoiceReviewRequest) (*order.InvoiceReviewResponse, error) {
	//业务逻辑
	invoice, err := dao.InvoiceReview(in)
	if err != nil {
		pkg.Error("获取发票信息失败", zap.Error(err))
		return nil, err
	}
	return &order.InvoiceReviewResponse{
		InvoiceId: int64(invoice.Id),
	}, nil
}
